package com.bcinfo.iccard.service;


import com.bcinfo.iccard.exception.ExpensiveRecordsNotExistException;
import com.bcinfo.iccard.exception.IccardDatabaseException;
import com.bcinfo.iccard.exception.InvalidParametersException;
import com.bcinfo.iccard.exception.MerchantBillingExpenseRecordErrorException;
import com.bcinfo.iccard.exception.MerchantBillingFuncErrorException;
import com.bcinfo.iccard.exception.MerchantIsNotExistException;
import com.bcinfo.iccard.model.CardSaleTotal;
import com.bcinfo.iccard.model.Merchant;
import com.bcinfo.iccard.model.MerchantSettlementAmountDetail;
import com.bcinfo.iccard.model.SettlementExportReport;
import com.bcinfo.iccard.util.PaginationList;

public interface FinancialManageService
{
    /**
     * 销售额统计 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-17-上午11:26:09<br/>
     * <p>
     * 
     * @param beginTime
     * @param endTime
     * @param pageNo
     * @param pageSize
     * @return
     * @throws IccardDatabaseException
     * @throws InvalidParametersException
     * 
     */
    public PaginationList<CardSaleTotal> saleStatistics(String beginTime, String endTime, int pageNo, int pageSize)
            throws IccardDatabaseException, InvalidParametersException;

    /**
     * 净销售总额汇总 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-17-上午11:43:37<br/>
     * <p>
     * 
     * @param beginTime
     * @param endTime
     * @return
     * 
     */
    public float selectTotalSaleAmount(String beginTime, String endTime);

    /**
     * <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-17-下午04:56:53<br/>
     * <p>
     * 
     * @param merchantCode
     * @param merchantCheckStatus
     * @param merchantStatus
     * @param pageNo
     * @param pageSize
     * @return
     * @throws IccardDatabaseException
     * @throws InvalidParametersException
     * 
     */
    public PaginationList<Merchant> findByCodeAndStatus(String merchantCode, Short merchantCheckStatus,
            Short merchantStatus, int pageNo, int pageSize) throws IccardDatabaseException, InvalidParametersException;

    /**
     * 更新状态 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-19-下午03:13:14<br/>
     * <p>
     * 
     * @param merchantId
     * @param billingStatus
     * @return
     * @throws IccardDatabaseException
     * @throws MerchantBillingFuncErrorException
     * @throws MerchantBillingExpenseRecordErrorException
     * 
     */
    int updateStatus(Long merchantId, Integer billingStatus) throws IccardDatabaseException,
            MerchantBillingFuncErrorException, MerchantBillingExpenseRecordErrorException;

    /**
     * 根据状态查询报表<br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-19-下午06:03:18<br/>
     * <p>
     * 
     * @param exportReportStatus
     * @param pageNo
     * @param pageSize
     * @return
     * @throws IccardDatabaseException
     * @throws InvalidParametersException
     * 
     */
    public PaginationList<SettlementExportReport> findReportsExportByStatus(Short exportReportStatus, String beginTime,
            String endTime, int pageNo, int pageSize) throws IccardDatabaseException, InvalidParametersException;

    /**
     * 商家未结算明细 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: Administrator<br/>
     * <p>Date: 2013-12-20-下午03:30:18<br/>
     * <p>
     * @param reportId
     * @param merchantName
     * @param beginTime
     * @param endTime
     * @param pageNo
     * @param pageSize
     * @return
     * @throws IccardDatabaseException
     * @throws InvalidParametersException   
     * 
     */
    public PaginationList<MerchantSettlementAmountDetail> findNotSettleMerchantDetails(Long settlementExportReportId,
            String merchantName, String beginTime, String endTime, int pageNo, int pageSize)
            throws IccardDatabaseException, InvalidParametersException;

    
    /**
     * 导出报表 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: Administrator<br/>
     * <p>Date: 2013-12-20-下午05:26:40<br/>
     * <p>
     * @param settlementExportReportId
     * @return   
     * @throws IccardDatabaseException 
     * @throws MerchantIsNotExistException 
     * @throws ExpensiveRecordsNotExistException 
     * 
     */
    int exportReport(Long settlementExportReportId) throws IccardDatabaseException, MerchantIsNotExistException, ExpensiveRecordsNotExistException;
    
    int exportReportAll() throws IccardDatabaseException, InvalidParametersException, MerchantIsNotExistException, ExpensiveRecordsNotExistException;
    
    SettlementExportReport findByReportId(Long reportId) throws IccardDatabaseException;
}
